<TITLE>Darwin Open Systems: RMI Callback Demo</TITLE>
<BODY>
<H1>Darwin Open Systems: RMI Callback Demo</H1>
<P>This demonstration simulate a Stock Price notification service.
In this demo, a client registers itself with a remote registry.
The remote registry remembers the reference and, when it has
information to share (faked up, for now, in its run method),
it notifies the client by calling the "alert" method.
Its important to notice that the ClientInterface is also a remote
interface, so that the Register has a stub, to call the real ClientImpl
(in ClientProgram), so that the output appears on the client side.
If it were not a Remote object, the server would be given a copy,
which would run on the server, and be unable to communicate directly
with the server - not useful!
<P>And notice that, since the Register only knows the client by
its Interface, one could change the client implementation (to, say,
a GUI with a pop-up window; this would be more attention-getting)
without any changes to the Register program.
<P>This type of callback scenario has many applications, including
an RMI-based 'chat' program, and RMI-based "intelligent agents".
<OL>
<LI><A HREF="RegisterInterface.java">The interface used by the client to register</A>
<LI><A HREF="RegisterImpl.java">The remote registration object implementation</A>
<LI><A HREF="ServerMain.java">The trivial remote server program</A>
<LI><A HREF="ClientInterface.java">The interface the Registrar uses to call back to the client</A>
<LI><A HREF="ClientProgram.java">All-in-one client of the Register, implementation of the ClientInterface, and server program</A>
<LI><A HREF="build+run.txt">Building and Running instructions (.bat or .sh)</A>
</OL>
